<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="product" tagdir="/WEB-INF/tags/product"%>
<%@ taglib prefix="order" tagdir="/WEB-INF/tags/order"%>

<form class="mainForm" name="orderListForm" method="post" id="orderListForm" action="${ctxPath}/order/salesOrder.html">
	<div class="top clearfix">
		<ul class="tab">
			<c:forEach begin="0" end="8" varStatus="varStatus">
				<li <c:if test="${(orderSearchCriteria.quickFilter == varStatus.index) or (empty orderSearchCriteria.quickFilter and varStatus.index==0)}">class="curr"</c:if> onclick='searchOrders(true,{"quickFilter":${varStatus.index}})'><span><fmt:message key="salesOrder.tab.quickFilter.${varStatus.index}"/></span></li>
			</c:forEach>
			<probiz:plugin_tip id="quickFilter_tip"><fmt:message key="salesOrder.tab.quickFilter.tip" /></probiz:plugin_tip>
		</ul>
		<%@include file="/common/pagingOnlyTop.jsp"%>
	</div>
	<div class="data">		
		<c:set var="checkAll">
			<input type="checkbox" name="allbox" onclick="checkAll(this.form)"	class="checkbox" />
		</c:set>
		<c:set var="isNeedTopPaging" value="true"/>
		<table id="order" width="100%" border="0" cellspacing="0" cellpadding="0" class="list_table" style="table-layout:fixed;">	
			<tr>
			  	<th width="20"><input onclick="checkAll(this.form)" name="allbox" type="checkbox" value="" /></th>	
				<th style="width:20px;">
					<span class="expand" onclick="toggleScreenAll(this)" ></span>
				</th>
				<th style="width:110px;" class='sortable ${(orderSearchCriteria.orderby eq 1)?"sorted order1":((orderSearchCriteria.orderby eq 2)?"sorted order2":"")}'>
					<a onclick="sortField(this,1,2)"><fmt:message key="salesOrder.orderNo" /></a>
				</th>
				<th  style="width:80px;" class='sortable ${(orderSearchCriteria.orderby eq 3)?"sorted order1":((orderSearchCriteria.orderby eq 4)?"sorted order2":"")}'>
					<a onclick="sortField(this,3,4)"><fmt:message key="salesOrder.createTime" /></a>
				</th>
				<th style="width:80px;"  class='sortable ${(orderSearchCriteria.orderby eq 5)?"sorted order1":((orderSearchCriteria.orderby eq 6)?"sorted order2":"")}'>
					<a onclick="sortField(this,5,6)"><fmt:message key="salesOrder.totalAmount" /></a>
				</th>
				<th  style="width:8%"  class='sortable ${(orderSearchCriteria.orderby eq 7)?"sorted order1":((orderSearchCriteria.orderby eq 8)?"sorted order2":"")}'>
					<a onclick="sortField(this,7,8)"><fmt:message key="salesOrder.orderAddress.firstname" /></a>
				</th>
				<th  style="width:12%"  class='sortable ${(orderSearchCriteria.orderby eq 9)?"sorted order1":((orderSearchCriteria.orderby eq 10)?"sorted order2":"")}'>
					<a onclick="sortField(this,9,10)"><fmt:message key="salesOrder.paymentTypeDesc" /></a>
				</th>
				<th  style="width:15%"  class='sortable ${(orderSearchCriteria.orderby eq 11)?"sorted order1":((orderSearchCriteria.orderby eq 12)?"sorted order2":"")}'>
					<a onclick="sortField(this,11,12)"><fmt:message key="salesOrder.deliveryTypeDesc" /></a>
				</th>
				<th  style="width:70px;" class='sortable ${(orderSearchCriteria.orderby eq 13)?"sorted order1":((orderSearchCriteria.orderby eq 14)?"sorted order2":"")}'>
					<a onclick="sortField(this,13,14)"><fmt:message key="salesOrder.paymentStatus" /></a>
				</th>
				<th  style="width:70px;" class='sortable ${(orderSearchCriteria.orderby eq 15)?"sorted order1":((orderSearchCriteria.orderby eq 16)?"sorted order2":"")}'>
					<a onclick="sortField(this,15,16)"><fmt:message key="salesOrder.shipmentStatus" /></a>
				</th>
				<th  style="width:120px;" class='sortable ${(orderSearchCriteria.orderby eq 17)?"sorted order1":((orderSearchCriteria.orderby eq 18)?"sorted order2":"")}'>
					<a onclick="sortField(this,17,18)"><fmt:message key="salesOrder.orderStatus" /></a>
				</th>
				<th style="">
					<span><fmt:message key="tags.name" /></span>
				</th>
			</tr>
			<c:forEach var="order" items="${orderList}" varStatus="status">
				<tr id="tr${order.salesOrderId}" orderId="${order.salesOrderId}" class="${(status.index%2==0)?'even':'odd'}">
					<%@include file="orderTrInList.jsp" %>
				</tr>
				<tr style="display: none;" class="${(status.index%2==0)?'even':'odd'} sub" >
				</tr>	
			</c:forEach>
			<c:if test="${empty orderList}">
				<tr>
					<td colspan="12" style="text-align:center">
						<fmt:message key="salesOrderList.empty"/>
					</td>
				</tr>
			</c:if>
		</table>	
		<%@include file="/common/pagingOnly.jsp" %>
	</div>
</form>
<%--------保存查询条件 -------%>
<%@include file="orderSearchCriteriaStorage.jspf"%>

<script type="text/javascript">
$j(document).ready(function () {
	highlightTableRows("order");
});
</script>
